<template>
  <div>
    <!-- 添加或修改生产管理对话框 -->
    <el-dialog :title="textMap[dialogStatus]" :visible.sync="visible" :before-close="beforeClose" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row :gutter="10">
         <el-col :span="12">
           <el-form-item label="名称" prop="name">
             <el-input v-model="form.name" placeholder="请输入名称" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="生产编号" prop="code">
             <el-input v-model="form.code" placeholder="请输入生产编号" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="销售编号" prop="salecode">
             <el-input v-model="form.salecode" placeholder="请输入销售编号" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="物料id" prop="invid">
             <el-input v-model="form.invid" placeholder="请输入物料id" />
           </el-form-item>
         </el-col>
                              <el-form-item label="日期" prop="date">
                                  <el-date-picker clearable
                                                  v-model="form.date"
                                                  type="date"
                                                  value-format="yyyy-MM-dd"
                                                  placeholder="请选择日期">
                                  </el-date-picker>
                              </el-form-item>
         <el-col :span="12">
           <el-form-item label="删除标志" prop="delFlag">
             <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="备注" prop="memo">
             <el-input v-model="form.memo" placeholder="请输入备注" />
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="部门id" prop="deptid">
             <el-input v-model="form.deptid" placeholder="请输入部门id" />
           </el-form-item>
         </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submit">确 定</el-button>
        <el-button @click="beforeClose">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { produce } from "@/api/business/produce";
import { editMixin } from '@/mixins/edit'

export default {
  name: "Produce",
  mixins: [ editMixin ],
  data() {
    return {
      //数据校验规则
      rules: {}
    };
  },
  props: {

  },
  created() {

  },
  methods: {
    //调用save接口
    callSave(form) {
      return new Promise(function(resolve, reject) {
        produce.save(form).then((res) => {
          resolve(res);
        }).catch((error) => {
          reject(error)
        });
      });
    },
  }
};
</script>
